<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table {
            border-left: solid 1px #ddd;
            border-top: solid 1px #ddd;
            margin: auto;
            border-collapse: collapse;
        }

        td {
            border-right: solid 1px #ddd;
            border-bottom: solid 1px #ddd;
            height: 40px;
            width: 200px;
        }
    </style>
</head>
<body>
    <table>
        <tr>
            <td>1</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>2</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>3</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>4</td>
            <td>张三</td>
            <td>18岁</td>
        </tr>
    </table>
    <button onclick="clone()">克隆</button>
    <script>
        //找到table
        var table = document.querySelector('table');
        function clone(){
            // 找到所有的行
            var trs = table.querySelectorAll('tr');
            // 获取最后一个元素
            var last = trs[trs.length - 1];
            var newTr = last.cloneNode(true); // 克隆最后一行
            table.appendChild(newTr);
        }
    </script>
</body>
</html>